package com.ruoyi.web.controller.presure;

import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.pressure.domain.KyLaneBmwy;
import com.ruoyi.pressure.service.IKyLaneBmwyService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;

/**
 * 巷道面位移测点基本信息数据项说明Controller
 * 
 * @author ruoyi
 * @date 2024-11-03
 */
@RestController
@RequestMapping("/pressure/bmwy")
public class KyLaneBmwyController extends BaseController
{
    @Autowired
    private IKyLaneBmwyService kyLaneBmwyService;

    /**
     * 查询巷道面位移测点基本信息数据项说明列表
     */
    @PreAuthorize("@ss.hasPermi('pressure:bmwy:list')")
    @GetMapping("/list")
    public TableDataInfo list(KyLaneBmwy kyLaneBmwy)
    {
        startPage();
        List<KyLaneBmwy> list = kyLaneBmwyService.selectKyLaneBmwyList(kyLaneBmwy);
        return getDataTable(list);
    }

    /**
     * 导出巷道面位移测点基本信息数据项说明列表
     */
    @PreAuthorize("@ss.hasPermi('pressure:bmwy:export')")
    @Log(title = "巷道面位移测点基本信息数据项说明", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, KyLaneBmwy kyLaneBmwy)
    {
        List<KyLaneBmwy> list = kyLaneBmwyService.selectKyLaneBmwyList(kyLaneBmwy);
        ExcelUtil<KyLaneBmwy> util = new ExcelUtil<KyLaneBmwy>(KyLaneBmwy.class);
        util.exportExcel(response, list, "巷道面位移测点基本信息数据项说明数据");
    }

    /**
     * 获取巷道面位移测点基本信息数据项说明详细信息
     */
    @PreAuthorize("@ss.hasPermi('pressure:bmwy:query')")
    @GetMapping(value = "/{laneBmwyId}")
    public AjaxResult getInfo(@PathVariable("laneBmwyId") String laneBmwyId)
    {
        return success(kyLaneBmwyService.selectKyLaneBmwyByLaneBmwyId(laneBmwyId));
    }

    /**
     * 新增巷道面位移测点基本信息数据项说明
     */
    @PreAuthorize("@ss.hasPermi('pressure:bmwy:add')")
    @Log(title = "巷道面位移测点基本信息数据项说明", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody KyLaneBmwy kyLaneBmwy)
    {
        return toAjax(kyLaneBmwyService.insertKyLaneBmwy(kyLaneBmwy));
    }

    /**
     * 修改巷道面位移测点基本信息数据项说明
     */
    @PreAuthorize("@ss.hasPermi('pressure:bmwy:edit')")
    @Log(title = "巷道面位移测点基本信息数据项说明", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody KyLaneBmwy kyLaneBmwy)
    {
        return toAjax(kyLaneBmwyService.updateKyLaneBmwy(kyLaneBmwy));
    }

    /**
     * 删除巷道面位移测点基本信息数据项说明
     */
    @PreAuthorize("@ss.hasPermi('pressure:bmwy:remove')")
    @Log(title = "巷道面位移测点基本信息数据项说明", businessType = BusinessType.DELETE)
	@DeleteMapping("/{laneBmwyIds}")
    public AjaxResult remove(@PathVariable String[] laneBmwyIds)
    {
        return toAjax(kyLaneBmwyService.deleteKyLaneBmwyByLaneBmwyIds(laneBmwyIds));
    }
}
